from cn.redguest.pbase.biz.Stock import *
import numpy as np
from sklearn import preprocessing


def main():
    min_max_scaler = preprocessing.MinMaxScaler((0, 1))

    stock_data = get_data_set("dat/600300.csv")
    data = []
    for stock in stock_data:
        stock_info = []
        for i in range(1, 7):
            stock_info.append(stock[i])
        data.append(stock_info)

    np_array = np.asarray(data).astype(np.float32)
    min_max_scaler.fit(np_array)
    np_transformed = min_max_scaler.transform(np_array)
    for i in range(np_transformed.shape[0]):
        print(np_transformed[i])


if __name__ == '__main__':
    main()
